#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "mem_pool.h"


int main(int argc , char * argv[]){
   pool_t *pool = create_pool(500);

   printf("pool max:%ld size:%ld\n",pool->max,(pool->d.end - pool->d.last));


   char * m = pool_calloc(pool,30);
   strcpy(m,"abcdef");
   //memset(m,0,30);

   printf("pool max:%ld size:%ld\n",pool->max,(pool->d.end - pool->d.last));

   m = pool_calloc(pool,5001);
    
   printf("pool max:%ld size:%ld\n",pool->max,(pool->d.end - pool->d.last));


   pool_cleanup_t *c = pool_cleanup_add(pool,0);
   c->data = malloc(3);
   c->handler = free;

   
   printf("pool max:%ld size:%ld\n",pool->max,(pool->d.end - pool->d.last));

   destroy_pool(pool); 
   return 0;
}
